package hu;

import java.util.*;

public class hu64 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        sc.nextLine();
        char[] ch = sc.nextLine().toCharArray();
        int cur = 1; //当前在第一首歌的位置
        if(n <= 4){
            int [] screen = new int[n];
            for (int i = 0; i < n; i++) {
                screen[i] = i + 1;
            }
            for (int i = 0; i < ch.length; i++) {
                if(ch[i] == 'U'){
                    if(cur == 1)
                        cur = n;
                    else
                        cur = cur - 1;
                }
                else {
                    if(cur == n)
                        cur = 1;
                    else
                        cur = cur + 1;
                }
            }
            for (int i = 0; i < screen.length; i++)
                System.out.print(screen[i] + " ");
            System.out.println();
            System.out.println(cur);
        }
        else{
            LinkedList<Integer> screen = new LinkedList<>();
            screen.add(1);
            screen.add(2);
            screen.add(3);
            screen.add(4);
            for (int i = 0; i < ch.length; i++) {
                if(ch[i] == 'U'){
                    if (cur == screen.peek() && cur == 1){
                        screen.clear();
                        cur = n;
                        screen.add(n - 3);
                        screen.add(n - 2);
                        screen.add(n - 1);
                        screen.add(n);
                    }
                    else if (cur == screen.peek() && cur != 1){
                        cur -= 1;
                        screen.addFirst(cur);
                        screen.removeLast();
                    }
                    else{
                        cur -= 1;
                    }
                }
                else{
                    if (cur == screen.getLast() && cur == n){
                        screen.clear();
                        cur = 1;
                        screen.add(1);
                        screen.add(2);
                        screen.add(3);
                        screen.add(4);
                    }
                    else if (cur == screen.getLast() && cur != n){
                        cur += 1;
                        screen.removeFirst();
                        screen.addLast(cur);
                    }
                    else{
                        cur += 1;
                    }
                }
            }
            for(int p : screen)
                System.out.print(p + " ");
            System.out.println();
            System.out.println(cur);
            return;
        }
    }
}
